﻿@{
    Layout = null;
}

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
<form id="form1">
    <div>
        <input type="button" onclick="UpdateSubmit('createMenu')" value="创建菜单" style="height: 21px"/>
        <input type="button" onclick="UpdateSubmit('selectMenu')" value="查询菜单" style="height: 21px" />
        <input type="button" onclick="UpdateSubmit('deleteMenu')" value="删除菜单" style="height: 21px" />
        结果：
        <span id="result"></span>
    </div>
</form>
</body>
</html>
<script type="text/javascript">

    //注册检测
    function UpdateSubmit(operation) {
        //var ret = checkForm();
        //if (!ret) {
        //    return;
        //}
        $.ajax({
            url: "/MenuForm/MenuOperation?@Html.Raw(Request.QueryString.ToString())",
            data: {
                'operation': operation
            },
            type: "POST",
            success: function (data) {
                //提交成功直接转入地址
                if (data.code === 1) {
                    $("#result").text(data.msg);
                    @*if (data.ReturnUrl === "" || data.ReturnUrl == null) {
                        window.location.href = "@SiteUrls.Instance().Success()";
                    } else {
                        window.location.href = decodeURIComponent(data.ReturnUrl);
                    }*@
                } else {
                    alert(data.msg);
                }
            },
            error: function () {
                alert("服务器开小差了，请重试");
            }
        });
    }
</script>
